<?php
/**
 * Registration Redirector for Jom Social 1.5.x
 **/
defined('_JEXEC') or die('Restricted access to this plugin'); 
 
$mainframe->registerEvent( 'onAfterRoute', 'redir' );

function redir() {
	$option = JRequest::getCmd('option');
	$task = JRequest::getCmd('task');
	$view = JRequest::getCmd('view');
	
	// get plugin info
	$plugin =& JPluginHelper::getPlugin('system', 'js_regredirect');
 	$params = new JParameter($plugin->params);
	
	$register    = $params->get('register', 1);
 		
		if ($option=='com_user' && $task=='register' && $register==1){
			mosRedirect(("index.php?option=com_community&view=register"));		  
		}
}
